/*
 * @Descripttion: 接口返回状态码
 * @Define: 定义
 * @Use: 使用
 * @Author: yeming
 * @Date: 2018-06-16 11:27:52
 */

import router from '@/router';
import COOKIE from "@/common/scripts/cookie";
import DonMessage from '@/common/scripts/message';

export function statusConfig (status, tips) {
  switch (status) {
    case 100000013:
    case 100000025: // token 失效
      COOKIE.clearAll();
      setTimeout(() => {
        router.push({
          path: "/login"
        });
      }, 1000);
      break;
    default:
      DonMessage.warning(tips || "接口异常");
      break;
  }
};
